package com.yh.action;

import com.yh.entity.User;
import com.yh.services.IUserService;
import com.yh.services.impl.UserServiceImpl;
import com.yh.util.BaseAction;

import java.util.List;

import static com.opensymphony.xwork2.Action.SUCCESS;

public class ShowUserAction extends BaseAction {



    public String execute(){
        IUserService iUserService=new UserServiceImpl();
       List<User> users=iUserService.showAll();

       if (users!=null){
           getSession().setAttribute("list",users);
           return SUCCESS;
       }else {
           return "out";
       }
    }

}
